import Vue from 'vue'
import store from '@/store'

// 判断字段的有无
const checktValue = Vue.filter('checktValue', value => {
    if (value === null || value === '' || value == undefined) {
        return '无'
    }
    return value
})

const processCate = Vue.filter('processCate', value=>{
    let dict = store.getters.dict;
    let cates = dict.filter(item=>item.key === "process_type");
    if(cates.length===0){
        return "无该分类"
    }
    let target = cates[0].value.filter(item=>item.dictValue === value)
    return target.length===0?"无该分类":target[0].dictLabel;
})


export default {
    checktValue,
    processCate
}
